{% import "macros/page.html" as page_macros %}
{% extends "base.html" %}

{% block title %}{{ trans(key="blog", lang=lang) }} - {{ config.title }}{% endblock title %}

{% block content %}
<main id="main" tabindex="-1">
    {% block heading %}
    <p>
        {% if section.relative_path is ending_with("." ~ lang ~ ".md") %}
            {% set tags_url = "/" ~ lang ~ "/tags" %}
        {% else %}
            {% set tags_url = "/tags" %}
        {% endif %}
        {{ trans(key="view_by", lang=lang) }}: <a href={{ tags_url }}>{{ trans(key="tags", lang=lang) }}</a>
    </p>
    {% endblock heading %}
    {% if paginator.pages %}
        {% for page in paginator.pages %}
            {{ page_macros::page_listing(page=page) }}
        {% endfor %}
        {{ page_macros::page_pagination(paginator=paginator) }}
    {% else %}
        {% for page in section.pages %}
            {{ page_macros::page_listing(page=page) }}
        {% endfor %}
    {% endif %}
</main>
{% endblock content %}
